package com.enterprise.dao.impl;

import com.enterprise.dao.BaseDao;
import com.enterprise.dao.EnterpriseDao;
import com.enterprise.entity.Enterprise;
import com.enterprise.entity.page.PageModel;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;


@Repository("enterpriseDao")
public class EnterpriseDaoImpl implements EnterpriseDao {
    @Resource
    private BaseDao dao;


    public void setDao(BaseDao dao) {
        this.dao = dao;
    }

    @Override
    public int insert(Enterprise enterprise) {
        return dao.insert("enterprise.insert",enterprise);
    }

    @Override
    public int delete(Enterprise enterprise) {
        return dao.delete("enterprise.delete",enterprise);
    }

    @Override
    public int update(Enterprise enterprise) {
        return dao.update("enterprise.update",enterprise);
    }

    @Override
    public Enterprise selectOne(Enterprise enterprise) {
        return (Enterprise) dao.selectOne("enterprise.selectOne",enterprise);
    }

    @Override
    public PageModel selectPageList(Enterprise enterprise) {
        return dao.selectPageList("enterprise.selectPageList","enterprise.selectPageCount",enterprise);
    }

    @Override
    public List<Enterprise> selectList(Enterprise enterprise) {
        return dao.selectList("enterprise.selectList",enterprise);
    }

    @Override
    public int deleteById(int id) {
        return dao.delete("enterprise.deleteById",id);
    }

    @Override
    public Enterprise selectById(int id) {
        return (Enterprise) dao.selectOne("enterprise.selectById",id);
    }
}
